<template>
  <div class="multiVModelWrap">
    <p>子组件获取的position: {{ position }} <button @click="sonChangePosition">子组件改变position</button></p>
    <p>子组件获取的month: {{ month }} <button @click="sonChangeMonth">子组件改变month</button></p>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  components: {},
  props: {
    position: {
      type: String,
      required: true,
      default: "",
    },
    month: {
      type: String,
      required: true,
      default: "",
    },
  },
  emits: [],
  data() {},
  methods: {
    sonChangePosition() {
      this.$emit("update:position", "西安");
    },
    sonChangeMonth() {
      this.$emit("update:month", "7");
    },
  },
});
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
